package z_ksiazki;

import java.util.Observable;

/**
 * Author: Daniel Michalski
 * Date: 14.03.13
 */

public class BeingWatched extends Observable {
    public void counter(int period) {
        for ( ; period >= 0 ; period--) {
            setChanged();
            notifyObservers(new Integer(period));
            try {
                Thread.sleep(500);
            } catch (InterruptedException ex) {
                System.out.println("Przerwano operację wstrzymania");
            }
        }
    }
}
